package com.wang.interview.tests.innerclass;



/**
 * @author: wang
 * @date: 2021/8/17 19:37
 * @description: 测试各种内部类的加载时机,答案就是内部类就的加载与外部类无关，懒加载
 */
public class T1 {

    class A {
        int a = get();
        int get(){
            System.out.println("123");
            return 1;
        }
    }

    private class B {
        int a = get();
        int get(){
            System.out.println("123");
            return 1;
        }
    }

    static class C {
        static int a = get();
        static int get(){
            System.out.println("123");
            return 1;
        }
    }


    public static void main(String[] args) {
        T1 t1 = new T1();
        // t1.new C();    // 静态内部类不能被实例化
        t1.new B();
    }
}
